<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Sprotty Layout Strategies Showcase</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/page.css">
</head>

<body>
    <div class="container">
        <div class="row" id="sprotty-app" data-app="layout-strategies-showcase">
            <div class="col-md-10">
                <h1>Sprotty Layout Strategies Showcase</h1>
                <p>This example demonstrates the different layout strategies available in Sprotty and how to configure
                    them for various use cases.</p>
            </div>
            <div class="help col-md-2">
                <a href="https://sprotty.org/docs/recipes/layout-strategies/">Layout Strategies Recipe</a>
            </div>
        </div>

        <div class="explanation">
            <h2>Layout Strategy Comparison</h2>
            <p>Sprotty provides two main layout strategies that can be used independently or in combination:</p>
            <ul>
                <li><strong>Micro-Layout Only:</strong> All layout computation happens in the browser. Perfect for
                    content-heavy nodes with nested compartments, multiple sections, status indicators, and complex
                    internal structures. Nodes are not positioned by the macro-layout engine but set to a fixed position
                    in the model.</li>
                <li><strong>Macro-Layout Only:</strong> Layout is computed by sophisticated algorithms (like ELK).
                    Ideal for complex network topologies and large diagrams requiring optimal node positioning.</li>
                <li><strong>Hybrid Layout:</strong> Combines both approaches - external layout engine computes node
                    positions while
                    the browser handles internal content layout. Best for complex diagrams with rich content.</li>
            </ul>
        </div>

        <div class="controls">
            <h3>Layout Strategy:</h3>
            <button id="client-layout-btn" class="layout-btn active">Micro-Layout</button>
            <button id="server-layout-btn" class="layout-btn">Macro-Layout</button>
            <button id="hybrid-layout-btn" class="layout-btn">Hybrid Layout</button>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div id="sprotty" class="sprotty"></div>
            </div>
        </div>


        <div class="copyright">
            &copy; 2025 <a href="https://www.typefox.io/">TypeFox GmbH</a>.
        </div>
    </div>

    <script src="../resources/bundle.js"></script>
</body>

</html>